package com.company;

import org.junit.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class TaxiChargingTest_YFQ {

    // 测试在8公里以内的里程数
    @Test
    public void test_calculateFare_within8km() {
        double fare = TaxiCharging_YFQ.calculateFare(8, 0);
        assertEquals(6.4, fare, 0.001);
    }
    // 测试超过8公里的
    @Test
    public void test_calculateFare_over8km() {
        double fare = TaxiCharging_YFQ.calculateFare(9, 0);
        assertEquals(7.05, fare, 0.001);
    }
    // 测试等待费
    @Test
    public void test_calculateFare_withWaiting() {
        double fare = TaxiCharging_YFQ.calculateFare(5, 5);
        assertEquals(4.25, fare, 0.001);
    }
}


